package com.fs.erp.api.basedata.entity;

import java.io.Serializable;
import lombok.Data;

/**
 * 商品和销售属性值关系表
 * @TableName base_data_product_saleprop_item_relation
 */
@Data
public class ProductSalepropItemRelation implements Serializable {
    /**
     * ID
     */
    private String id;

    /**
     * 聚合ID
     */
    private String polyId;

    /**
     * 商品ID
     */
    private String productId;

    /**
     * 销售属性组ID1
     */
    private String salePropGroupId1;

    /**
     * 销售属性ID1
     */
    private String salePropItemId1;

    /**
     * 销售属性组ID2
     */
    private String salePropGroupId2;

    /**
     * 销售属性ID2
     */
    private String salePropItemId2;

    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        ProductSalepropItemRelation other = (ProductSalepropItemRelation) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getPolyId() == null ? other.getPolyId() == null : this.getPolyId().equals(other.getPolyId()))
            && (this.getProductId() == null ? other.getProductId() == null : this.getProductId().equals(other.getProductId()))
            && (this.getSalePropGroupId1() == null ? other.getSalePropGroupId1() == null : this.getSalePropGroupId1().equals(other.getSalePropGroupId1()))
            && (this.getSalePropItemId1() == null ? other.getSalePropItemId1() == null : this.getSalePropItemId1().equals(other.getSalePropItemId1()))
            && (this.getSalePropGroupId2() == null ? other.getSalePropGroupId2() == null : this.getSalePropGroupId2().equals(other.getSalePropGroupId2()))
            && (this.getSalePropItemId2() == null ? other.getSalePropItemId2() == null : this.getSalePropItemId2().equals(other.getSalePropItemId2()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getPolyId() == null) ? 0 : getPolyId().hashCode());
        result = prime * result + ((getProductId() == null) ? 0 : getProductId().hashCode());
        result = prime * result + ((getSalePropGroupId1() == null) ? 0 : getSalePropGroupId1().hashCode());
        result = prime * result + ((getSalePropItemId1() == null) ? 0 : getSalePropItemId1().hashCode());
        result = prime * result + ((getSalePropGroupId2() == null) ? 0 : getSalePropGroupId2().hashCode());
        result = prime * result + ((getSalePropItemId2() == null) ? 0 : getSalePropItemId2().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", polyId=").append(polyId);
        sb.append(", productId=").append(productId);
        sb.append(", salePropGroupId1=").append(salePropGroupId1);
        sb.append(", salePropItemId1=").append(salePropItemId1);
        sb.append(", salePropGroupId2=").append(salePropGroupId2);
        sb.append(", salePropItemId2=").append(salePropItemId2);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}